#pragma once
#include "ReflectStatic.h"
//#include "ALuaEx.h"
#include <thread>
class Person
{
public:
	int age;
	std::string name;
	double height = 1.5;
	static int count;
	//std::thread t;
	Person() {
		++count;
	}
	virtual void show() const {
		printf("age: %d\nname: %s\nheight: %f\n", age, name.c_str(), height);
	}
	void add_height(double h) {
		height += h;
	}
	static void show_type() {
		printf("Person type is Person, count = %d\n", count);
	}
	void set_name(const std::string& n) {
		name = n;
	}
	void get_name(std::string& n) {
		n = name;
	}
	void operator()(std::string arg) {
		printf("call person: %s\n", arg.c_str());
	}
	enum 
	{
		PERSON = 0,
		STUDENT = 1
	};
};

Reflect_Class(Person);
Reflect_Class_Field(Person, age);
Reflect_Class_Field(Person, name);
Reflect_Class_Field(Person, height);
Reflect_Class_Method(Person, show);
Reflect_Class_Method(Person, add_height);
Reflect_Class_Method(Person, show_type);
Reflect_Class_Method(Person, set_name);
Reflect_Class_Method(Person, get_name);
Reflect_Class_Field(Person, count);


class Student : public Person
{
public:
	std::string school;
	int id;
	int get_id()const {
		return id;
	}
};

Reflect_Class(Student, Person);
Reflect_Class_Field(Student, school);
Reflect_Class_Field(Student, id);
Reflect_Class_Method(Student, get_id);
class Male
{
public:
	int gender = 0;
	void show_gender()const {
		printf("I am male, my gender is %d\n", gender);
	}
};

Reflect_Class(Male);
Reflect_Class_Method(Male, show_gender);

class MaleStudent : public Student, public Male
{
public:
	int money = 0;
	void show()const override {
		Student::show();
		printf("I am male student, have money %d\n", money);
		printf("my id is %d\n", id);
		printf("my school is %s\n", school.c_str());
	}
};

Reflect_Class(MaleStudent, Student, Male);
Reflect_Class_Field(MaleStudent, money);

namespace Test
{
	class InSpace
	{

	};
}
using InSpace = Test::InSpace;
Reflect_Class(InSpace);